const fs = require("fs");
const path = require("path");

let sFilePath = path.join(__dirname, "from.txt");
let dFilePath = path.join(__dirname, "to.txt");

let readStream = fs.createReadStream(sFilePath);
let writeStream = fs.createWriteStream(dFilePath);

readStream.on("data" , (chunk) => {

    const upperCaseChunk = chunk.toString().toUpperCase();
    writeStream.write(upperCaseChunk);
})
readStream.on("end" , ()=> {
    writeStream.end();
    console.log("已转入");
})